from app.jobs.pdfparser.internal.server.pdfparserserver import KafkaConsumerConf
from common.model.milvus_utils import MilvusConf
from common.rpc.stub import RpcStubConfig
from pydantic import BaseModel, ConfigDict, Field
from pydantic_settings import BaseSettings

from common.utils import logger
    
class MinioConf(BaseModel):
    endpoint: str = Field(alias="Endpoint")
    access_key: str = Field(alias="AccessKey")
    secret_key: str = Field(alias="SecretKey")
    bucket: str = Field(alias="Bucket")
    
class AliEmbeddingsConf(BaseModel):
    api_key: str = Field(alias="ApiKey")
    model: str = Field(alias="Model")
    
class AliLlmConf(BaseModel):
    base_url: str = Field(alias="BaseUrl")
    api_key: str = Field(alias="ApiKey")
    model: str = Field(alias="Model")

class Config(BaseSettings):
    model_config = ConfigDict(extra="ignore")
    
    log: logger.LogConf = Field(alias="Log")
    
    kafka_consumer_conf: KafkaConsumerConf = Field(alias="KafkaConsumerConf")
    paperfile_stub_conf: RpcStubConfig = Field(alias="PaperFileRpcConf")
    minio_conf: MinioConf = Field(alias="MinioConf")
    milvus_conf: MilvusConf = Field(alias="MilvusConf")
    ali_embeddings_conf: AliEmbeddingsConf = Field(alias="AliEmbeddingsConf")
    ali_llm_conf: AliLlmConf = Field(alias="AliLlmConf")